<script language="javascript" type="text/javascript" src="/vendere-jscript/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
	mode : "textareas",
	theme : "advanced",
	plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
	theme_advanced_buttons1_add_before : "save,separator",
	theme_advanced_buttons1_add : "fontselect,fontsizeselect",
	theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
	theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
	theme_advanced_buttons3_add_before : "tablecontrols,separator",
	theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "bottom",
	theme_advanced_resizing : true,
	// Example content CSS (should be your site CSS)
	content_css : "./shop.css",
	plugin_insertdate_dateFormat : "%Y-%m-%d",
	plugin_insertdate_timeFormat : "%H:%M:%S",
	extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
	spellchecker_languages : "+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv"
	
});
function toggleEditor(id) {
	var elm = document.getElementById(id);

	if (tinyMCE.getInstanceById(id) == null)
		tinyMCE.execCommand('mceAddControl', false, id);
	else
		tinyMCE.execCommand('mceRemoveControl', false, id);
}
</script>

<?php

$strScreenName = 'DisplayAuctionItem';
$strQueryName = 'qryAddAuctionItem';
$strFormName = 'frmEnterAuctionItem';
//$strRefresh = $strFormName.".SCREEN.value='".$strScreenName."';".$strFormName.".ACTION.value='';".$strFormName.".submit()";

     if (($intAuctionItemID) && (!$strReprocessing)) {
             include (MODULE . "/action/qrySelectAuctionItem");
             $strTitle = "Update";
             $strButtonTitle = "update";
             $txtID = stripslashes($myrow["ID"]);
             $txtVendor = stripslashes($myrow["Vendor"]);
			 $txtItemName = stripslashes(eregi_replace("\"", "&quot;", $myrow["ItemName"]));
             //$txtItemName = stripslashes($myrow["ItemName"]);	
			 $chkDespatchToUK =	stripslashes($myrow["DespatchToUK"]);
			 $chkDespatchToUSA = stripslashes($myrow["DespatchToUSA"]);
			 $chkDespatchToEurope =	stripslashes($myrow["DespatchToEurope"]);
			 $chkDespatchToAustralia = stripslashes($myrow["DespatchToAustralia"]);
             $txtDescription = stripslashes($myrow["Description"]);	
			 $cboDisclaimer = stripslashes($myrow["Disclaimer"]);
			 $cboCommission = stripslashes($myrow["Commission"]);
             $cboCondition = stripslashes($myrow["Condition"]);
             $txtReservePrice = stripslashes($myrow["ReservePrice"]);
             $txtReserveFee = stripslashes($myrow["ReserveFee"]);
             $txtCostPrice = stripslashes($myrow["CostPrice"]);
             $chkVAT = stripslashes($myrow["VAT"]);
             $cboVatRate = stripslashes($myrow["VatRate"]);
             $txtVATNumber = stripslashes($myrow["VATNumber"]);
             $txtBackgroundHistory = stripslashes($myrow["BackgroundHistory"]);
             $chkUnderWarranty = stripslashes($myrow["UnderWarranty"]);
             $chkManual = stripslashes($myrow["Manual"]);
             $txtHeight = stripslashes($myrow["Height"]);
             $txtWidth = stripslashes($myrow["Width"]);
             $txtLength = stripslashes($myrow["Length"]);
             $txtWeight = stripslashes($myrow["Weight"]);
             $txtQuantity = stripslashes($myrow["Quantity"]);
             $chkPhotos = stripslashes($myrow["Photos"]);
             $txtUploadedPhoto1 = stripslashes($myrow["UploadedPhoto1"]);
             $txtUploadedPhoto2 = stripslashes($myrow["UploadedPhoto2"]);
             $txtUploadedPhoto3 = stripslashes($myrow["UploadedPhoto3"]);
             $txtUploadedPhoto4 = stripslashes($myrow["UploadedPhoto4"]);
             $txtUploadedPhoto5 = stripslashes($myrow["UploadedPhoto5"]);
             $txtUploadedPhoto6 = stripslashes($myrow["UploadedPhoto6"]);
             $txtUploadedPhoto7 = stripslashes($myrow["UploadedPhoto7"]);
             $txtUploadedPhoto8 = stripslashes($myrow["UploadedPhoto8"]);
             $txtUploadedPhoto9 = stripslashes($myrow["UploadedPhoto9"]);
             $chkDirectDespatch = stripslashes($myrow["DirectDespatch"]);
             $cboEbayStatus = stripslashes($myrow["EbayStatus"]);
             $txtQuotedCarriage = stripslashes($myrow["QuotedCarriage"]);
             $txtEbayInsertionFee = stripslashes($myrow["EbayInsertionFee"]);
             $txtAuctionStart = ReformatFromMySqlDate($myrow["AuctionStart"]);
             $txtAuctionDuration = stripslashes($myrow["AuctionDuration"]);
             $txtAuctionID = stripslashes($myrow["AuctionID"]);
             $txtAuctionSellingFee = stripslashes($myrow["AuctionSellingFee"]);
             $chkReceivedPayment = stripslashes($myrow["ReceivedPayment"]);
             $txtPayPalFee = stripslashes($myrow["PayPalFee"]);
			 $txtCarriagePaid = stripslashes($myrow["CarriagePaid"]);
			 $txtOurCommission = stripslashes($myrow["OurCommission"]);
			 $txtPayUs = stripslashes($myrow["PayUs"]);
			 $txtPayVendor = stripslashes($myrow["PayVendor"]);
			 $txtDatePaid = ReformatFromMySqlDate($myrow["DatePaid"]);
			 $txtPayPalTXN = stripslashes($myrow["PayPalTXN"]);
             $txtPurchaserEbayID = stripslashes($myrow["PurchaserEbayID"]);
             $cboTitle = stripslashes($myrow["Title"]);
             $txtCompanyName = stripslashes($myrow["CompanyName"]);
             $txtFirstName = stripslashes($myrow["FirstName"]);
             $txtSurname = stripslashes($myrow["Surname"]);
             $txtAddress1 = stripslashes($myrow["Address1"]);
             $txtAddress2 = stripslashes($myrow["Address2"]);
             $txtTown = stripslashes($myrow["Town"]);
             $txtCounty = stripslashes($myrow["County"]);
             $txtPostalCode = stripslashes($myrow["PostalCode"]);
             $cboCountry = stripslashes($myrow["Country"]);
             $txtPhone = stripslashes($myrow["Phone"]);
             $txtMobile = stripslashes($myrow["Mobile"]);
             $txtFax = stripslashes($myrow["Fax"]);
             $txtEmail = stripslashes($myrow["Email"]);
             $chkDespatched = stripslashes($myrow["Despatched"]);
             $txtDespatchDate = ReformatFromMySqlDate($myrow["DespatchDate"]);
             $cboCourier = stripslashes($myrow["Courier"]);
             $txtConsignmentNumber = stripslashes($myrow["ConsignmentNumber"]);
             $txtChequeSent = ReformatFromMySqlDate($myrow["ChequeSent"]);
         }else{
		 	if(!$cboEbayStatus){$cboEbayStatus = 1;}
             $strTitle = "Enter new";
             $strButtonTitle = "save";
             if($txtID){ $txtID = stripslashes(eregi_replace("\"", "&quot;", $txtID)); }
             if($txtVendor){ $txtVendor = stripslashes(eregi_replace("\"", "&quot;", $txtVendor)); }
             if($txtItemName){ $txtItemName = stripslashes(eregi_replace("\"", "&quot;", $txtItemName)); }
             if($cboDisclaimer){
			 
			 }else{
			 	  $cboDisclaimer = 2;  //set to default
				  
			 }
			 if($txtDescription){ 
			 	$txtDescription = stripslashes(eregi_replace("\"", "&quot;", $txtDescription)); 
			 }else{
				$txtDescription = "
				<br/><b>DESCRIPTION</b>
				<br/>
				<br/>xxxxxxxxxx
				<br/>
				<br/><b>FEATURES &amp; SPECIFICATION</b>
				<br/>
				<br/>xxxxxxxxx
				<br/>
				<br/><b>CONDITION</b>
				<br/>
				<br/>Used 
				<br/>New in box.
				<br/>
				<br/>Sturdy 
				<br/>Solid
				<br/>Marked, please see photos.
				<br/>
				<br/><b>MEASUREMENTS</b>
				<br/>
				<br/>Width     (cm)   (inches)
				<br/>Length    (cm)   (inches) 
				<br/>Depth     (cm)   (inches)
				<br/>Height    (cm)   (inches)
				<br/>
				<br/><b>TESTING</b>
				<br/>
				<br/>Powers up.
				<br/>Untested.
				<br/>N.A.
				<br/>
				<br/>
 				";
			 }

         	 if($cboCommission){ $cboCommission = stripslashes(eregi_replace("\"", "&quot;", $cboCommission)); }
             if($txtVATNumber){ $txtVATNumber = stripslashes(eregi_replace("\"", "&quot;", $txtVATNumber)); }
             if($txtBackgroundHistory){ $txtBackgroundHistory = stripslashes(eregi_replace("\"", "&quot;", $txtBackgroundHistory)); }
             if($txtHeight){ $txtHeight = stripslashes(eregi_replace("\"", "&quot;", $txtHeight)); }
             if($txtWidth){ $txtWidth = stripslashes(eregi_replace("\"", "&quot;", $txtWidth)); }
             if($txtLength){ $txtLength = stripslashes(eregi_replace("\"", "&quot;", $txtLength)); }
             if($txtWeight){ $txtWeight = stripslashes(eregi_replace("\"", "&quot;", $txtWeight)); }
             if($txtQuantity){ $txtQuantity = stripslashes(eregi_replace("\"", "&quot;", $txtQuantity)); }
             if($txtUploadedPhoto1){ $txtUploadedPhoto1 = stripslashes(eregi_replace("\"", "&quot;", $txtUploadedPhoto1)); }
             if($txtUploadedPhoto2){ $txtUploadedPhoto2 = stripslashes(eregi_replace("\"", "&quot;", $txtUploadedPhoto2)); }
             if($txtUploadedPhoto3){ $txtUploadedPhoto3 = stripslashes(eregi_replace("\"", "&quot;", $txtUploadedPhoto3)); }
             if($txtUploadedPhoto4){ $txtUploadedPhoto4 = stripslashes(eregi_replace("\"", "&quot;", $txtUploadedPhoto4)); }
             if($txtUploadedPhoto5){ $txtUploadedPhoto5 = stripslashes(eregi_replace("\"", "&quot;", $txtUploadedPhoto5)); }
             if($txtUploadedPhoto6){ $txtUploadedPhoto6 = stripslashes(eregi_replace("\"", "&quot;", $txtUploadedPhoto6)); }
             if($txtUploadedPhoto7){ $txtUploadedPhoto7 = stripslashes(eregi_replace("\"", "&quot;", $txtUploadedPhoto7)); }
             if($txtUploadedPhoto8){ $txtUploadedPhoto8 = stripslashes(eregi_replace("\"", "&quot;", $txtUploadedPhoto8)); }
             if($txtUploadedPhoto9){ $txtUploadedPhoto9 = stripslashes(eregi_replace("\"", "&quot;", $txtUploadedPhoto9)); }
             if($txtAuctionDuration){ $txtAuctionDuration = stripslashes(eregi_replace("\"", "&quot;", $txtAuctionDuration)); }
             if($txtAuctionID){ $txtAuctionID = stripslashes(eregi_replace("\"", "&quot;", $txtAuctionID)); }
             if($txtPurchaserEbayID){ $txtPurchaserEbayID = stripslashes(eregi_replace("\"", "&quot;", $txtPurchaserEbayID)); }
             if($cboTitle){ $cboTitle = stripslashes(eregi_replace("\"", "&quot;", $cboTitle)); }
             if($txtCompanyName){ $txtCompanyName = stripslashes(eregi_replace("\"", "&quot;", $txtCompanyName)); }
             if($txtFirstName){ $txtFirstName = stripslashes(eregi_replace("\"", "&quot;", $txtFirstName)); }
             if($txtSurname){ $txtSurname = stripslashes(eregi_replace("\"", "&quot;", $txtSurname)); }
             if($txtAddress1){ $txtAddress1 = stripslashes(eregi_replace("\"", "&quot;", $txtAddress1)); }
             if($txtAddress2){ $txtAddress2 = stripslashes(eregi_replace("\"", "&quot;", $txtAddress2)); }
             if($txtTown){ $txtTown = stripslashes(eregi_replace("\"", "&quot;", $txtTown)); }
             if($txtCounty){ $txtCounty = stripslashes(eregi_replace("\"", "&quot;", $txtCounty)); }
             if($txtPostalCode){ $txtPostalCode = stripslashes(eregi_replace("\"", "&quot;", $txtPostalCode)); }
             if($cboCountry){ $cboCountry = stripslashes(eregi_replace("\"", "&quot;", $cboCountry)); }else{  $cboCountry = 202;}
             if($txtPhone){ $txtPhone = stripslashes(eregi_replace("\"", "&quot;", $txtPhone)); }
             if($txtMobile){ $txtMobile = stripslashes(eregi_replace("\"", "&quot;", $txtMobile)); }
             if($txtFax){ $txtFax = stripslashes(eregi_replace("\"", "&quot;", $txtFax)); }
             if($txtEmail){ $txtEmail = stripslashes(eregi_replace("\"", "&quot;", $txtEmail)); }
             if($txtConsignmentNumber){ $txtConsignmentNumber = stripslashes(eregi_replace("\"", "&quot;", $txtConsignmentNumber)); }
     }
?>
<?php echo StartForm($strScreenName, "post", $strQueryName,array('intAuctionItemID'=>$intAuctionItemID,'strReprocessing'=>'True'),"","multipart/form-data",$strFormName,"","return frmEnterAuctionItem_onsubmit()")?>
<table  width='100%' cellpadding='0' cellspacing='0' border='0' align='center'>
     <tr align='left'>
         <td align='left' colspan='2'>
             <H2><?php echo $strTitle?> Auction Item&nbsp;<?php echo $txtID."&nbsp;".$txtItemName?></H2>
         </td>
     </tr>
     <tr>
         <td align='right' colspan='2'>
             <input type='image' src='./images/<?php echo $strButtonTitle ?>.gif' alt='<?php echo $strButtonTitle ?>'>
         </td>
     </tr>	  
	  <tr>
         <td align='left' colspan='2'>
        	<h2><?php  echo DisplayLookupValue("tblVendor","concat(Surname, \", \",FirstName, \", \",Address1)",$txtVendor)?></h2>
		 </td>
     </tr>
    
	 <tr>
         <td align='right' colspan='1'>
		 	<b>Item Name :&nbsp;</b>
		 </td>
         <td align='left'>
		 	<input type="text" name="txtItemName" value = "<?php echo $txtItemName?>" size= "80" maxlength="255">
         </td>
     </tr>
      <tr>
         <td align='right' colspan='1'>
         	<b>Commission</b>
     	</td>
         <td align='left'>
        	<?php  echo CreateDropDown("cboCommission","SELECT ID, Commission FROM tblAuctionCommission", "", $cboCommission);?>
		 </td>
     </tr>
	 <tr>
	 	<td align='right' colspan='1'>
             <b>Status :&nbsp;</b>
		 </td>
		 <td>
             <?php CreateDropDown("cboEbayStatus", "SELECT * FROM tblEbayStatus", "", $cboEbayStatus);?>
         </td>
     </tr> 
	<?php 
	//switch ($cboEbayStatus){
	//case 0:
	//case 1:
	?>
    

     <tr>
         <td align='right' colspan='2'>
             <input type="hidden" name="txtVendor" value = "<?php echo $txtVendor?>" size= "8" maxlength="8">
         </td>
     </tr>
	 
	 <tr align='left'>
         <td align='right'>
             <b>Item Type Disclaimer :&nbsp;</b>
         </td>
         <td align='left'>
		 	<?php
             CreateDropDown("cboDisclaimer", "SELECT * FROM tblDisclaimer ORDER BY 2", "", $cboDisclaimer);
			?>
             <a href='<?php echo ScreenURL("EnterDisclaimer")?>' target='_blank'>+</a>
         </td>
     </tr>	
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Weight (kg) :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type="text" name="txtWeight" value = "<?php echo $txtWeight?>" size= "8" maxlength="8">
         </td>
     </tr>	
	 
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Carriage :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type="text" name="txtQuotedCarriage" value = "<?php echo $txtQuotedCarriage?>" size= "6" maxlength="6">	<span class="Small">(Will override postage calculations and will only ship to UK)</span>
         </td>
     </tr>
	 
	 <tr>	  
	 	<td align='right'>
             <b>Post To :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
             <table border='0'>
			 	<tr align='center'>
					<td width='60'><strong>UK</strong></td> <td width='60'><strong>Europe</strong></td><td width='60'><strong>USA</strong></td>	<td width="60"><strong>Rest Of World</strong></td>
				</tr>
				
				<tr align='center'>
					<td><input type="checkbox" name="chkDespatchToUK" value='1' <?php if ($chkDespatchToUK == '1'){echo 'checked';} ?> ></td> 
					<td><input type="checkbox" name="chkDespatchToEurope" value='1' <?php if ($chkDespatchToEurope == '1'){echo 'checked';} ?> ></td>
					<td><input type="checkbox" name="chkDespatchToUSA" value='1' <?php if ($chkDespatchToUSA == '1'){echo 'checked';} ?> ></td>	
					<td><input type="checkbox" name="chkDespatchToAustralia" value='1' <?php if ($chkDespatchToAustralia == '1'){echo 'checked';} ?> ></td>
				</tr>
			 
			 </table>
         </td>
     </tr>
	 
	 
	 


     <tr>
         <td align='right' colspan='1' valign='top'>
             <b>Description :&nbsp;</b><br />

		 </td>
		 <td align='left'>
			<a href="javascript:toggleEditor('txtDescription');">Add/Remove editor</a><br />
             <textarea cols='80' rows='30' name="txtDescription"><?php echo $txtDescription?></textarea>
         </td>
     </tr>
	 
     <tr align='left'>
         <td align='right'>
             <b>Condition : </b>
         </td>
         <td align='left'>
		 	<?php CreateDropDown("cboCondition", "SELECT * FROM tblCondition ORDER BY 2", "", $cboCondition);?>
             <a href='<?php echo ScreenURL("EnterCondition")?>' target='_blank'>+</a>
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Reserve Price :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type="text" name="txtReservePrice" value = "<?php echo $txtReservePrice ?>" size= "20" maxlength="20">
         </td>
     </tr>
	 
	 

     <tr>
         <td align='right' colspan='1'>
             <b>Reserve Fee :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type="text" name="txtReserveFee" value = "<?php echo  $txtReserveFee ?>" size= "20" maxlength="20">
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Cost Price :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
			<input type="text" name="txtCostPrice" value = "<?php echo $txtCostPrice ?>" size= "20" maxlength="20">
         </td>
     </tr>
<!-- 
     <tr align='left'>
         <td align='right' colspan='1'>
             <b>VAT : </b>
		 </td>
         <td align='left'>
                 <input type="checkbox" name="chkVAT" value='1' <?php //if ($chkVAT == '1'){echo 'checked';} ?> >
         </td>
     </tr>

     <tr align='left'>
         <td align='right'>
             <b>Vat Rate :</b>
         </td>
         <td align='left'>
             <?php //CreateDropDown("cboVatRate", "SELECT * FROM tblVatRate ORDER BY 2", "", $cboVatRate);?>

             <a href='<?php //echo ScreenURL("EnterVatRate")?>' target='_blank'>+</a>
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>VAT Number :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type="text" name="txtVATNumber" value = "<?php //echo $txtVATNumber ?>" size= "15" maxlength="15">
         </td>
     </tr>

     

     <tr align='right'>
         <td align='right' colspan='1'>
             <b>Warranty :</b>
		 </td>
         <td align='left'>
                 <input type="checkbox" name="chkUnderWarranty" value='1' <? //if ($chkUnderWarranty == '1'){echo 'checked';}?> >
         </td>
     </tr>

     <tr align='left'>
         <td align='right' colspan='1'>
             <b>Manuals Included :</b>	
		 </td>
         <td align='left'>
                 <input type="checkbox" name="chkManual" value='1' <?php //if ($chkManual == '1'){echo 'checked';} ?> >
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Height (cm):&nbsp;</b>
		 </td>
         <td align='left'>
             <input type="text" name="txtHeight" value = "<?php //echo $txtHeight?>" size= "20" maxlength="50">
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Width (cm):&nbsp;</b>
		 </td>
         <td align='left'>
             <input type="text" name="txtWidth" value = "<?php //echo $txtWidth?>" size= "20" maxlength="50">
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Length / Depth (cm):&nbsp;</b>
         </td>
         <td align='left'>
             <input type="text" name="txtLength" value = "<?php //echo $txtLength ?>" size= "20" maxlength="50">
         </td>
     </tr>

     

     <tr>
         <td align='right' colspan='1'>
             <b>Quantity :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type="text" name="txtQuantity" value = "<?php //echo $txtQuantity ?>" size= "4" maxlength="4">
         </td>
     </tr> -->

     <tr align='left'>
         <td align='right' colspan='1'>
             <b>Taken Photos :</b>
		 </td>
         <td align='left' colspan='1'>
                 <input type="checkbox" name="chkPhotos" value='1' <?php if ($chkPhotos == '1'){echo 'checked';}?> >
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Upload Photo 1 :&nbsp;</b> 
			 <img src='./images/auction/thumbz/<?php echo $myrow["UploadedPhoto1"]?>' border='0' alt='Item <?php echo $myrow["ID"]?>' width='100'>
		 </td>
         <td align='left' colspan='1'>
		 	
             <?php CreateDropDown("cboUploadedPhoto1", "SELECT * FROM tblYesNo ORDER BY 2", "", $cboUploadedPhoto1);  ?>

			<input type="file" name="txtUploadedPhoto1" value = "<?php echo $txtUploadedPhoto1?>" size= "25" maxlength="100">
         </td>
     </tr>	  
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Upload Photo 2 :&nbsp;</b>
			 <?php if($myrow["UploadedPhoto2"] != 'none'){ ?><img src='./images/auction/thumbz/<?php echo $myrow["UploadedPhoto2"]?>' border='0' alt='Item <?php echo $myrow["ID"]?>' width='100'><?php }?>
		 </td>
         <td align='left' colspan='1'> 
		 	
             <?php CreateDropDown("cboUploadedPhoto2", "SELECT * FROM tblYesNo ORDER BY 2", "", $cboUploadedPhoto2);  ?>

			<input type="file" name="txtUploadedPhoto2" value = "<?php echo $txtUploadedPhoto2?>" size= "25" maxlength="50">
         </td>
     </tr>	
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Upload Photo 3 :&nbsp;</b>
			 <?php if($myrow["UploadedPhoto3"]){ ?><img src='./images/auction/thumbz/<?php echo $myrow["UploadedPhoto3"]?>' border='0' alt='Item <?php echo $myrow["ID"]?>' width='100'><?php }?>
		 </td>
         <td align='left' colspan='1'>	

             <?php CreateDropDown("cboUploadedPhoto3", "SELECT * FROM tblYesNo ORDER BY 2", "", $cboUploadedPhoto3);  ?>

			<input type="file" name="txtUploadedPhoto3" value = "<?php echo $txtUploadedPhoto3?>" size= "25" maxlength="50">
         </td>
     </tr>	 
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Upload Photo 4 :&nbsp;</b>
			 		 	<?php if($myrow["UploadedPhoto4"]){ ?><img src='./images/auction/thumbz/<?php echo $myrow["UploadedPhoto4"]?>' border='0' alt='Item <?php echo $myrow["ID"]?>' width='100'><?php }?>
		 </td>
         <td align='left' colspan='1'>

             <?php CreateDropDown("cboUploadedPhoto4", "SELECT * FROM tblYesNo ORDER BY 2", "", $cboUploadedPhoto4);  ?>

			<input type="file" name="txtUploadedPhoto4" value = "<?php echo $txtUploadedPhoto4?>" size= "25" maxlength="50">
         </td>
     </tr>	   
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Upload Photo 5 :&nbsp;</b>
			 <?php if($myrow["UploadedPhoto5"]){ ?><img src='./images/auction/thumbz/<?php echo $myrow["UploadedPhoto5"]?>' border='0' alt='Item <?php echo $myrow["ID"]?>' width='100'><?php }?>
		 </td>
         <td align='left' colspan='1'> 
            <?php CreateDropDown("cboUploadedPhoto5", "SELECT * FROM tblYesNo ORDER BY 2", "", $cboUploadedPhoto5);  ?>

			<input type="file" name="txtUploadedPhoto5" value = "<?php echo $txtUploadedPhoto5?>" size= "25" maxlength="50">
         </td>
     </tr>		  
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Upload Photo 6 :&nbsp;</b> 
			 <?php if($myrow["UploadedPhoto6"]){ ?><img src='./images/auction/thumbz/<?php echo $myrow["UploadedPhoto6"]?>' border='0' alt='Item <?php echo $myrow["ID"]?>' width='100'><?php }?>
		 </td>
         <td align='left' colspan='1'>
             <?php CreateDropDown("cboUploadedPhoto6", "SELECT * FROM tblYesNo ORDER BY 2", "", $cboUploadedPhoto6);  ?>

			<input type="file" name="txtUploadedPhoto6" value = "<?php echo $txtUploadedPhoto6?>" size= "25" maxlength="50">
         </td>
     </tr>	  
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Upload Photo 7 :&nbsp;</b>
			 <?php if($myrow["UploadedPhoto7"]){ ?><img src='./images/auction/thumbz/<?php echo $myrow["UploadedPhoto7"]?>' border='0' alt='Item <?php echo $myrow["ID"]?>' width='100'><?php }?>
		 </td>
         <td align='left' colspan='1'>
             <?php CreateDropDown("cboUploadedPhoto7", "SELECT * FROM tblYesNo ORDER BY 2", "", $cboUploadedPhoto7);  ?>

			<input type="file" name="txtUploadedPhoto7" value = "<?php echo $txtUploadedPhoto7?>" size= "25" maxlength="50">
         </td>
     </tr>	   
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Upload Photo 8 :&nbsp;</b>
			 <?php if($myrow["UploadedPhoto8"]){ ?><img src='./images/auction/thumbz/<?php echo $myrow["UploadedPhoto8"]?>' border='0' alt='Item <?php echo $myrow["ID"]?>' width='100'><?php }?>
		 </td>
         <td align='left' colspan='1'>
             <?php CreateDropDown("cboUploadedPhoto8", "SELECT * FROM tblYesNo ORDER BY 2", "", $cboUploadedPhoto8);  ?>

			<input type="file" name="txtUploadedPhoto8" value = "<?php echo $txtUploadedPhoto8?>" size= "25" maxlength="50">
         </td>
     </tr>		  
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Upload Photo 9 :&nbsp;</b>
			<?php if($myrow["UploadedPhoto9"]){ ?><img src='./images/auction/thumbz/<?php echo $myrow["UploadedPhoto9"]?>' border='0' alt='Item <?php echo $myrow["ID"]?>' width='100'><?php }?>
		 </td>
         <td align='left' colspan='1'>
             <?php CreateDropDown("cboUploadedPhoto9", "SELECT * FROM tblYesNo ORDER BY 2", "", $cboUploadedPhoto9);  ?>

			<input type="file" name="txtUploadedPhoto9" value = "<?php echo $txtUploadedPhoto9?>" size= "25" maxlength="50">
         </td>
     </tr>


     <!-- <tr align='left'>
         <td align='right' colspan='1'>
             <b>Direct Despatch :</b>
		</td>
       <td align='left' colspan='1'>
                 <input type="checkbox" name="chkDirectDespatch" value='1' <?php //if ($chkDirectDespatch == '1'){echo 'checked';} ?> >
       </td>
     </tr>	   
	  -->
	 <tr>
         <td align='right' colspan='2'>
             <input type='image' src='./images/<?php echo $strButtonTitle ?>.gif' alt='<?php echo $strButtonTitle ?>'><hr>
         </td>
     </tr>
	<?php
	//break;
	
	//case 2:	 
	//Auction start details	
	?>
	
			 
	 <tr>
	 	<td colspan='2' align='left'>Fill in the following when loading on Ebay</td>
	</tr>
     
<?php

echo "
     <tr>
         <td align='right' colspan='1'>
             <b>Ebay Insertion Fee :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type=\"text\" name=\"txtEbayInsertionFee\" value = \"$txtEbayInsertionFee\" size= \"20\" maxlength=\"20\">
         </td>
     </tr>
";

//  Type                 8
//  atrributes           1
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        Auction Start
//  SourceField          AuctionStart
//  Required             True
echo "
     <tr>
         <td align='right' colspan='1'>
             <b>Auction Start :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
             <input type=\"text\" name=\"txtAuctionStart\" value = '$txtAuctionStart' size= \"10\" maxlength=\"10\">
         </td>
     </tr>
";

//  Type                 4
//  atrributes           1
//  AllowZeroLength      False
//  Default Value        7
//  Validate Rule        
//  Validate Text        
//  SourceField          AuctionDuration
//  Required             True
echo "
     <tr>
         <td align='right' colspan='1'>
             <b>AuctionDuration :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type=\"text\" name=\"txtAuctionDuration\" value = \"$txtAuctionDuration\" size= \"4\" maxlength=\"4\">
         </td>
     </tr>
";


?>
     <tr>
         <td align='right' colspan='1'>
             <b>Auction ID :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type="text" name="txtAuctionID" value = "<?php echo$txtAuctionID?>" size= "20" maxlength="20">
         </td>
     </tr>
		 
	<tr>
         <td align='right' colspan='2'>
             <input type='image' src='./images/<?php echo $strButtonTitle ?>.gif' alt='<?php echo $strButtonTitle ?>'><hr>
         </td>
     </tr>		 
	 <tr>
	 	<td colspan='2' align='left'>Fill in the following when auction ended</td>
	</tr>

<?php
	//break;
	
	//case 3:	 
	//Auction end details	
		?>

     <tr>
         <td align='right' colspan='1'>
             <b>Selling Price :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type="text" name="txtAuctionSellingFee" value = "<?php echo $txtAuctionSellingFee?>" size= "20" maxlength="20">
         </td>
     </tr>

	<tr>
         <td align='right' colspan='2'>
             <input type='image' src='./images/<?php echo $strButtonTitle ?>.gif' alt='<?php echo $strButtonTitle ?>'><hr>
         </td>
     </tr>		
	<?php
	//break;
	
	//case 4:	 
	//Auction start details	
	?> 
	 <tr>
	 	<td colspan='2' align='left'>Fill in the following when payment received</td>
	</tr>

     <tr align='left'>
         <td align='right' colspan='1'>
             <b>Received Payment : </b>
		 </td>
         <td align='left'>
                 <input type="checkbox" name="chkReceivedPayment" value='1' <? if ($chkReceivedPayment == '1'){echo 'checked';} ?> >
         </td>
     </tr>
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Pay Pal TXN ID :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           		<input type="text" name="txtPayPalTXN" value = "<?php echo $txtPayPalTXN;?>" size= "30" maxlength="50">
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Pay Pal Fee :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           		<input type="text" name="txtPayPalFee" value = "<?php echo $txtPayPalFee;?>" size= "6" maxlength="8">
         </td>
     </tr>	  
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Carriage Paid :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           		<input type="text" name="txtCarriagePaid" value = "<?php echo $txtCarriagePaid;?>" size= "6" maxlength="8">
         </td>
     </tr>	  
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Our Commission :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           		<input type="text" name="txtOurCommission" value = "<?php echo $txtOurCommission;?>" size= "6" maxlength="8">
         </td>
     </tr>	
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Our Total :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           		<input type="text" name="txtPayUs" value = "<?php echo $txtPayUs;?>" size= "6" maxlength="8">
         </td>
     </tr>	
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Pay Vendor :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           		<input type="text" name="txtPayVendor" value = "<?php echo $txtPayVendor;?>" size= "6" maxlength="8">
         </td>
     </tr>
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Date Paid :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           		<input type="text" name="txtDatePaid" value = "<?php echo $txtDatePaid;?>" size= "10" maxlength="10">
         </td>
     </tr>

     <tr align='right'>
         <td align='right' colspan='1'>
             <b>Calculate Commission : </b>
		 </td>
         <td align='left'>
                 <input type="checkbox" name="chkCalcCommission" value='1' <?php  if ($chkCalcCommission == '1'){echo 'checked';}?> >
         </td>
     </tr>
		   
	 <tr>
         <td align='left' colspan='2'>
             Purchaser Details
		 </td>
     </tr>	  
	 
	 <tr>
         <td align='right' colspan='1'>
             <b>Purchaser Ebay ID :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
             <input type="text" name="txtPurchaserEbayID" value = "<?php echo $txtPurchaserEbayID;?>" size= "50" maxlength="50">
         </td>
     </tr>
	 
     <tr>
         <td align='right' colspan='1'>
             <b>Company Name :&nbsp;</b>
		 </td>
         <td align='left' colspan='1'>
             <input type="text" name="txtCompanyName" value = "<?php echo $txtCompanyName ?>" size= "60" maxlength="100">
         </td>
     </tr>
			   
	 <tr>
         <td align='right' colspan='1'>
             <b>Purchaser Title :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <?php CreateDropDown("cboTitle", "SELECT * FROM tblTitle ORDER BY 2", "", $cboTitle);?>

		 </td>
	 </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Purchaser First Name :&nbsp;</b> 
		 </td>
         <td align='left' colspan='1'>
             <input type="text" name="txtFirstName" value = "<?php echo $txtFirstName?>" size= "40" maxlength="40">
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b> Purchaser Surname :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type="text" name="txtSurname" value = "<?php echo $txtSurname?>" size= "30" maxlength="30">
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Purchaser Address1 :&nbsp;</b>
		 </td>
         <td align='left'>
             <input type="text" name="txtAddress1" value = "<?php echo $txtAddress1?>" size= "30" maxlength="60">
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Purchaser Address2 :&nbsp;</b>
		 </td>
         <td align='left'>
             <input type="text" name="txtAddress2" value = "<?php echo $txtAddress2?>" size= "30" maxlength="60">
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Purchaser Town :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type="text" name="txtTown" value = "<?php echo $txtTown?>" size= "30" maxlength="30">
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Purchaser County :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type="text" name="txtCounty" value = "<?php echo $txtCounty?>" size= "25" maxlength="25">
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Purchaser Postal Code :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type="text" name="txtPostalCode" value = "<?php echo $txtPostalCode?>" size= "10" maxlength="10">
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Purchaser Country :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <?php CreateDropDown("cboCountry", "SELECT * FROM tblCountry ORDER BY 2", "", $cboCountry);?>
         
		 </td>
     </tr>
<?

//  Type                 10
//  atrributes           2
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        Purchaser Phone
//  SourceField          Phone
//  Required             True
echo "
     <tr>
         <td align='right' colspan='1'>
             <b>Purchaser Phone :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type=\"text\" name=\"txtPhone\" value = \"$txtPhone\" size= \"24\" maxlength=\"24\">
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Purchaser Mobile :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type=\"text\" name=\"txtMobile\" value = \"$txtMobile\" size= \"24\" maxlength=\"24\">
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Purchaser Fax :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type=\"text\" name=\"txtFax\" value = \"$txtFax\" size= \"24\" maxlength=\"24\">
         </td>
     </tr>

     <tr>
         <td align='right' colspan='1'>
             <b>Purchaser Email :&nbsp;</b>
		 </td>
         <td align='left'>
             <input type=\"text\" name=\"txtEmail\" value = \"$txtEmail\" size= \"80\" maxlength=\"100\">
         </td>
     </tr>
";
	  
?>
	<tr  align='left'>
         <td align='right' colspan='1'>
             <b>Additional Notes :</b>
		 </td>
         <td align='left'>
             <textarea cols=60 rows=6 name="txtBackgroundHistory"><?php echo $txtBackgroundHistory?></textarea>
         </td>
     </tr>	 
	 
<?php

	//break;
	
	//case 5:	 
	//Despatch details	

     echo "	
	 <tr>
         <td align='left' colspan='2'>
             <hr>
			 Despatch details
		 </td>
     </tr>
	 
     <tr align='left'>
         <td align='right' colspan='1'>
             <b>Despatched : </b>
		 </td>
         <td align='left'>
                 <input type=\"checkbox\" name=\"chkDespatched\" value='1' "; if ($chkDespatched == '1'){echo 'checked';} echo ">
         </td>
     </tr>
";
//  Type                 8
//  atrributes           1
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        Despatch Date
//  SourceField          DespatchDate
//  Required             False
echo "
     <tr>
         <td align='right' colspan='1'>
             <b>Despatch Date :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
             <input type=\"text\" name=\"txtDespatchDate\" value = '$txtDespatchDate' size= \"10\" maxlength=\"10\">
         </td>
     </tr>
";

//  Type                 3
//  atrributes           1
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        
//  SourceField          Courier
//  Required             False
echo "
     <tr align='left'>
         <td align='right'>
             <b>Courier : </b>
         </td>
         <td align='left'>";
             CreateDropDown("cboCourier", "SELECT * FROM tblCourier ORDER BY 2", "", $cboCourier);
echo "
             <a href='".ScreenURL("EnterCourier")."' target='_blank'>+</a>
         </td>
     </tr>
";
//  Type                 4
//  atrributes           1
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        Consignment Number
//  SourceField          ConsignmentNumber
//  Required             False
echo "
     <tr>
         <td align='right' colspan='1'>
             <b>Consignment Number :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
           <input type=\"text\" name=\"txtConsignmentNumber\" value = \"$txtConsignmentNumber\" size= \"20\" maxlength=\"20\">
         </td>
     </tr>
";


	//break;
	
	//case 6:	 
	//Cheque sent	

echo "
     <tr>
         <td align='right' colspan='1'>
             <b>Cheque Sent (date) :&nbsp;</b>
         </td>
         <td align='left' colspan='1'>
             <a name='DespatchedDate' id='DespatchedDate'></a><input type=\"text\" name=\"txtChequeSent\" value = '$txtChequeSent' size= \"10\" maxlength=\"10\">
         </td>
     </tr>
";

echo "
     <tr>
         <td align='right' colspan='2'>
             <input type='image' src='./images/$strButtonTitle.gif' alt='$strButtonTitle'>
         </td>
     </tr>
</table
</form>

";			
//}//end switch
     //$strListAll = "true";
       //include (MODULE . "/screen/ListAuctionItem");
?>
<script language="JavaScript">
<!--
function frmEnterAuctionItem_onsubmit() 
{


     if(document.frmEnterAuctionItem.txtItemName.value == "") {
         alert("Please enter Item  Name");
         document.frmEnterAuctionItem.txtItemName.focus();
         document.frmEnterAuctionItem.txtItemName.select();
         return(false);
     }

     if(document.frmEnterAuctionItem.txtDescription.value == "") {
         alert("Please enter Description");
         document.frmEnterAuctionItem.txtDescription.focus();
         document.frmEnterAuctionItem.txtDescription.select();
         return(false);
     }		 
	
    	
	var IncludeDocumentSelected = document.frmEnterAuctionItem.cboEbayStatus.options[document.frmEnterAuctionItem.cboEbayStatus.selectedIndex].value;  
		  if (IncludeDocumentSelected == 2){
		  	 if(document.frmEnterAuctionItem.txtWeight.value == 0) {
	         alert("Please enter weight");
	         document.frmEnterAuctionItem.txtWeight.focus();
	         document.frmEnterAuctionItem.txtWeight.select();
	         return(false);
     		}
		  
		  }

<?php
     if (!$intAuctionItemID){
         echo"
         
         var IncludeDocumentSelected = document.frmEnterAuctionItem.cboUploadedPhoto1.options[document.frmEnterAuctionItem.cboUploadedPhoto1.selectedIndex].value;
             if (IncludeDocumentSelected == 1){
                 if(document.frmEnterAuctionItem.txtUploadedPhoto1.value == \"\") {
                     alert('Please select file to upload');
                     document.frmEnterAuctionItem.txtUploadedPhoto1.focus();
                     document.frmEnterAuctionItem.txtUploadedPhoto1.select();
                     return(false);
                }
             }
         ";
     }
?>

var EbayStatusSelected = document.frmEnterAuctionItem.cboEbayStatus.options[document.frmEnterAuctionItem.cboEbayStatus.selectedIndex].value;
     if(EbayStatusSelected) {
     }else{
         alert("Please enter status");
         return(false);
     }

     


}
// -->
</script>
